package com.zrrd.utils;

import org.apache.ibatis.jdbc.SQL;

/**
 * @author WanJl
 * @version 1.0
 * @title BuildSql
 * @description
 * @create 2024/1/24 16:19
 */
public class BuildTeaSql {

    public String getSelectAll(){
        return new SQL(){
            {
                SELECT("*");
                FROM("tea");
            }
        }.toString();
    }

    public String getSelectById(){
        return new SQL(){
            {
                SELECT("*");
                FROM("tea");
                WHERE("id=#{id}");

            }
        }.toString();
    }


    public static void main(String[] args) {
        BuildTeaSql buildTeaSql = new BuildTeaSql();
        String selectAll = buildTeaSql.getSelectAll();
        String selectById = buildTeaSql.getSelectById();
        System.out.println(selectById);
        System.out.println(selectAll);
    }
}
